package entityJPA;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * The persistent class for the candidatecomment database table.
 * 
 */
@Entity
@Table(name = "candidatecomment")
@NamedQuery(name = "Candidatecomment.findAll", query = "SELECT c FROM Candidatecomment c")
public class Candidatecomment implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(unique = true, nullable = false)
	private int idCandidateComment;

	@Column(nullable = false, length = 200)
	private String candidateComment;

	// uni-directional many-to-one association to Candidate
	@ManyToOne
	@JoinColumn(name = "idCandidate", nullable = false)
	private Candidate candidate;

	// uni-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "idUser", nullable = false)
	private User user;

	public Candidatecomment() {
	}

	public int getIdCandidateComment() {
		return this.idCandidateComment;
	}

	public void setIdCandidateComment(int idCandidateComment) {
		this.idCandidateComment = idCandidateComment;
	}

	public String getCandidateComment() {
		return this.candidateComment;
	}

	public void setCandidateComment(String candidateComment) {
		this.candidateComment = candidateComment;
	}

	public Candidate getCandidate() {
		return this.candidate;
	}

	public void setCandidate(Candidate candidate) {
		this.candidate = candidate;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String toString() {
		return this.idCandidateComment + " " + candidateComment + " "
				+ candidate.getFirstName() + " " + candidate.getLastName();
	}

}